package com.ylbh.modules.cooperation.controller;

import com.ylbh.common.pojo.cooperation.dto.BusinessCooperationDTO;
import com.ylbh.common.utils.CommonResult;
import com.ylbh.common.utils.Ref;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.ylbh.modules.cooperation.entity.ShoppingBusinessCooperation;
import com.ylbh.modules.cooperation.service.ShoppingBusinessCooperationService;
import com.ylbh.common.utils.PageUtils;

/**
 *
 * 商务合作
 * @author czx
 * @date 2020-01-04 09:57:34
 */
@RestController
@RequestMapping("cooperation")
public class ShoppingBusinessCooperationController {

    @Autowired
    private ShoppingBusinessCooperationService shoppingBusinessCooperationService;

    @ApiOperation("商务合作申请列表")
    @GetMapping("/queryBusinessCooperationList")
    @RequiresPermissions("cooperation:queryBusinessCooperationList")
    public CommonResult queryBusinessCooperationList(BusinessCooperationDTO businessCooperationDTO){
        PageUtils page = shoppingBusinessCooperationService.queryBusinessCooperationList(businessCooperationDTO);
        return Ref.ok(page);
    }

    @ApiOperation("获取商务合作信息")
    @GetMapping("/getBusinessCooperationInfoId/{id}")
    @RequiresPermissions("cooperation:getBusinessCooperationInfoId")
    public CommonResult getBusinessCooperationInfoId(@PathVariable("id") String id){
		ShoppingBusinessCooperation shoppingBusinessCooperation = shoppingBusinessCooperationService.getBusinessCooperationInfoId(id);
        return Ref.ok(shoppingBusinessCooperation);
    }

}
